// Copyright 2008 Philip Allison <sane@not.co.uk>

//    This file is part of Infector.
//
//    Infector is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Infector is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Infector.  If not, see <http://www.gnu.org/licenses/>.

#ifndef __INFECTOR_AI4_HXX__
#define __INFECTOR_AI4_HXX__

#include "ai.hxx"
#include "list"

class Game;
class BoardState;

struct moveTree
{
  move *the_move;
  std::list<moveTree*>* trees;
  moveTree() {};
};

class AI4 : public AI
{
	public:
		AI4(Game *game, const BoardState *bs, const GameType *gt);
	
		// Signals we can emit
		sigc::signal<void, const int, const int> square_clicked;
		//bool movecmp(const std::pair<move, int> &a, const std::pair<move, int> &b);
	
	protected:
		
		// Event handlers
		void onMoveMade(const int start_x, const int start_y, const int end_x, const int end_y, const bool gameover);
		int alphaBeta(const BoardState *node, int currDepth, int maxDepth, int alpha, int beta, moveTree* tree);
		int heuristic(const BoardState *node);
		
};

#endif
